<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.tb_orderstate.Tb_orderstateInfo" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo" %>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%
	request.setCharacterEncoding("UTF-8");
	
	Hashtable params = new Hashtable();
	
	String o_order_no ="",o_order_source="",o_email="",o_start_date="",o_end_date="",o_user="",o_consignee="",o_zip_code="";
	String o_area_attr="",o_cellphone="",o_tel="",o_address="",o_shipping_id="",o_pay_id="",o_goods_name="";
	String o_cust="",o_order_state="";
	if(request.getParameter("o_order_no") !=null && !request.getParameter("o_order_no").equals(""))
	{
			o_order_no = request.getParameter("o_order_no");
			params.put("o_order_no",o_order_no);	
	}
	if(request.getParameter("o_start_date") !=null && !request.getParameter("o_start_date").equals(""))
	{
			o_start_date = request.getParameter("o_start_date");
			params.put("o_start_date",o_start_date);	
	}
	if(request.getParameter("o_end_date")!=null && !request.getParameter("o_end_date").equals(""))
	{
			o_end_date = request.getParameter("o_end_date");
			params.put("o_end_date",o_end_date);	
	}
	if(request.getParameter("o_order_state")!=null && !request.getParameter("o_order_state").equals(""))
	{
			o_order_state = request.getParameter("o_order_state");
			params.put("o_order_state",o_order_state);	
	}

	Tb_orderstateInfo tb_orderstateInfo = new Tb_orderstateInfo();

	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	
	List list = tb_orderstateInfo.getListByPage(params,Integer.parseInt(iStart),limit);
	int counter = tb_orderstateInfo.getCountByObj(params);
	
	String querpage="index.jsp?o_order_no="+o_order_no+"&o_order_source="+o_order_source+"&o_email="+o_email+"&o_start_date="+
	                o_start_date+"&o_end_date="+o_end_date+"&o_user="+o_user+"&o_consignee="+o_consignee+"&o_zip_code="+
	                o_zip_code+"&o_area_attr="+o_area_attr+"&o_cellphone="+o_cellphone+"&o_tel="+o_tel+"&o_address="+o_address+
	                "&o_shipping_id="+o_shipping_id+"&o_pay_id="+o_pay_id+"&o_goods_name="+o_goods_name+"&o_cust="+o_cust+
	                "&o_order_state="+o_order_state+"&iStart=";	
	String pageString = new PageTools().getGoogleToolsBar(counter,querpage,Integer.parseInt(iStart),limit);
  
  Tb_commparaInfo commparaInfo = new Tb_commparaInfo();
  String orderStateSelect = commparaInfo.getSelectItem("31",o_order_state);
 
%>
<html>
  <head>
    
   <title>ti_orderinfo Manager</title>
	 <link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	 <script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
   <script type="text/javascript" language="jscript" src="/js/prototype.js"></script>   
   <script type="text/javascript" src="floatDiv.js"></script>
   <link href="/program/admin/index/css/floatDiv.css" rel="stylesheet" type="text/css" />



</head>

<body>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="90%">
				<h1>订单处理日志</h1>
			</td>
			<td>
						</td>
		</tr>
	</table>
	
	<form action="index.jsp" name="indexForm" method="post">
	
	  
	<table width="100%" cellpadding="0" cellspacing="0" class="dl_su">
		<tr>
			<td align="left" >
				订单号:<input name="o_order_no" type="text" />
        处理时间:  
          <input name="o_start_date" type="text" id="o_start_date" class="Wdate" value="" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'o_end_date\',{d:-1})}',readOnly:true})" size="15"  width="150px"/>
            -
	        <input name="o_end_date" id="o_end_date" type="text" class="Wdate" value="" onclick="WdatePicker({minDate:'#F{$dp.$D(\'o_start_date\',{d:1})}',readOnly:true})" size="15" width="150px"/>
			        
         订单状态: 
         <select id="o_order_state" name="o_order_state">
			<option value="">请选择</option> 
			<%=orderStateSelect%>
	      </select>						
				
				<input name="searchInfo" type="button" value="查询" onclick="javascript:document.indexForm.submit();"/>	
			</td>
		</tr>
	</table>

	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<% 
		int listsize = 0;
		if(list!=null && list.size()>0){
			listsize = list.size();
	%>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
			                                                                                 			
			</td>
			<td>
				总计:<%=counter %>条			
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>
						
		  	<th>订单号</th>
		  	
		  	<th>处理时间</th>
		  	         
         <th>订单状态</th>
		  			  	
			  <th width="10%">操作人</th>
	  	  
	  	  </tr>
		
		
		<% 
		  		for(int i=0;i<list.size();i++){
		  			  Hashtable map = (Hashtable)list.get(i);
		  			  String order_no="",order_state="",add_time="",state_name = "",user_name="";
					  	 if(map.get("order_no")!=null) order_no = map.get("order_no").toString();
					  	 if(map.get("order_state")!=null) order_state = map.get("order_state").toString();
					  	 if(map.get("state_date")!=null) add_time = map.get("state_date").toString();
					     if(add_time.length()>19)add_time=add_time.substring(0,19);
						 if(map.get("state_name")!=null) state_name = map.get("state_name").toString();
						 if(map.get("user_name")!=null) user_name = map.get("user_name").toString();
     	  	
		  %>
		
		<tr>
					
		  	<td><a href="index.jsp?o_order_no=<%=order_no%>"><%=order_no%></a></td>
		  	
		  	<td><%=add_time%></td>
		  		  	
		  	<td><%=state_name%></td>

		 		  	
			<td width="10%"><%=user_name%></td>
	     </tr>
		
		  <%
		  		}
		  %>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
							</td>
			<td>
				总计:<%=counter %>条			
			</td>
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<%
		 }
	%>
	
	  <input type="hidden" name="listsize" id="listsize" value="<%=listsize %>" />
	  <input type="hidden" name="pkid" id="pkid" value="" />
	  <input type="hidden" name="bpm_id" id="bpm_id" value="0213" />
	  </form>
</body>

</html>
